# @Name:urls
# @author:22326
# @Description:
# @DATE:2022/6/28 16:13
# @Modified By:
from django.contrib.auth.decorators import login_required
from django.urls import path,re_path
from . import views

urlpatterns = [
    path('register/',views.RegisterView.as_view()),
    # 使用正则路由，则必须用re_path
    re_path(r'^usernames/(?P<username>[A-Za-z][A-Za-z0-9_]{4,7})/count/$',views.UserCountView.as_view()),
    re_path(r'^phones/(?P<phone>1[35789]\d{9})/count/$',views.PhoneCountView.as_view()),
    path('login/',views.LoginView.as_view()),
    path('logout/',views.LogouView.as_view()),
    path('usercenter/',login_required(views.UserCenterView.as_view())),
    path('emails/',views.EmailView.as_view())
]